<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>闰年查询</title>
</head>
<body>
    <script>
        function isRunNian(year){
                if(year%400==0){
                    return true;
                }else if(year%4==0&&year%100!=0){
                    return true;
                }else{ 
                    return false;
                }
        }
        var year = prompt("请输入一个年份");
        year = year*1;
        if(isRunNian(year)){
            alert("闰年");                                                                       
        }else{
            alert("平年");
        }




        // var year = prompt("请输入一个年份");
        // year = year*1;
        // if(year%400==0){
        //     return true;
        // }else if(year%4==0&&year%100!=0){
        //     return true;
        // }else{
        //     alert("平年");
        // }







    </script>
</body>
</html>